import request from './request'
import getMethods from './getMethods'
import equiMethods from './equiMethods'

//登录
export function login (data) {
    return request({
        url: '/user/login',
        data: data
    })
}
//验证密码
export function checkPassword (data) {
    return request({
        url: '/user/checkPassword',
        data: data
    })
}
//修改密码
export function changePassword (data) {
    return request({
        url: '/user/updatePassword',
        data: data
    })
}
//修改手机号
export function updateTelephone (data) {
    return request({
        url: '/user/updatePhone',
        data: data
    })
}
//个人信息查询接口
export function getUserByUid (data) {
    return request({
        url: '/user/getUserByUid',
        data: data
    })
}
// 坐席人员条件查询接口
export function getUserServiceStaffList (data) {
    return request({
        url: '/user/getUserServiceStaffList',
        data: data
    })
}
//设备公司条件查询接口
export function getEquipmentCompanyList (data) {
    return request({
        url: '/equipmentCompany/getEquipmentCompanyList',
        data: data
    })
}
//设备公司添加接口
export function saveEquipmentCompany (data) {
    return request({
        url: '/equipmentCompany/saveEquipmentCompany',
        data: data
    })
}
//房屋信息接口
export function getHouseList (data) {
    return request({
        url: '/house/getHouseList',
        data: data
    })
}
//房屋信息详细查询接口
export function getHouse (data) {
    return request({
        url: '/house/getHouse',
        data: data
    })
}
//设备信息查询接口
export function getDeviceList (data) {
    return request({
        url: '/equipmentInfo/getDeviceList',
        data: data
    })
}
//客户信息查询接口
export function getCustomerList (data) {
    return request({
        url: '/clientele/getCustomerList',
        data: data
    })
}
//客户中心接口
export function getCustomerByQuery (data) {
    return request({
        url: '/clientele/getCustomerByQuery',
        data: data
    })
}
//通过客户id获取客户信息接口
export function getCustomerById (data) {
    return request({
        url: '/clientele/getCustomerById',
        data:data
    })
}
//沟通记录接口
export function getCommunicationRecordList (data) {
    return request({
        url: '/communicationTypes/getCommunicationRecordList',
        data: data
    })
}
//添加坐席人员接口
export function saveUserServiceStaff (data) {
    return request({
        url: '/user/saveUserServiceStaff',
        data: data
    })
}
//修改坐席人员
export function updateUserServiceStaff (data) {
    return request({
        url: '/user/updateUserServiceStaff',
        data: data
    })
}
//启停坐席人员接口
export function updateUserServiceStaffState (data) {
    return request({
        url: '/user/updateUserServiceStaffState',
        data: data
    })
}
//业务人员条件按查询
export function getBusinessPersonnelByQuery(data) {
    return request({
        url: '/operationUser/getBusinessPersonnelByQuery',
        data: data
    })
}
//添加业务人员
export function saveBusinessPersonnel(data) {
    return request({
        url: '/operationUser/saveBusinessPersonnel',
        data: data
    })
}
//修改业务人员
export function updateBusinessPersonnel(data) {
    return request({
        url: '/operationUser/updateBusinessPersonnel',
        data: data
    })
}
//启停业务
export function updateBusinessPersonnelState(data) {
    return request({
        url: '/operationUser/updateBusinessPersonnelState',
        data: data
    })
}
// 验证账号是否存在
export function checkAccount(data) {
    return request({
        url: '/public/checkAccount',
        data: data
    })
}
//系统字典
export function getDictionaryValue(data) {
    return request({
        url: '/public/getDictionaryValue',
        data: data
    })
}
//工单记录接口
export function getWorkOrderRecordList(data) {
    return request({
        url: '/workOrderRecord/getWorkOrderRecordList',
        data: data
    })
}
// 角色模块
export function getModels(data) {
    return request({
        url: '/model/getModels',
        data: data
    })
}
export function picImg (data) {
    return request({
        url: '/public/getImgSignURL',
        data: data
    })
}
export function record (data) {
    return request({
        url: '/workorder/getWorkOrderRecordfault',
        data: data
    })
}


//======================================


//任务类型接口
export function getTaskTypes (data) {
    return request({
        url: '/communicationTypes/getTaskTypes',
        data: data
    })
}

//任务类型新增接口
export function saveTaskType (data) {
    return request({
        url: '/communicationTypes/saveTaskType',
        data: data
    })
}
//任务类型编辑接口
export function updateTaskType (data) {
    return request({
        url: '/communicationTypes/updateTaskType',
        data: data
    })
}

//企业信息接口
export function getCompany (data) {
    return request({
        url: '/company/getCompany',
        data: data
    })
}
//启停任务类型，沟通类型接口
export function startStopState (data) {
    return request({
        url: '/communicationTypes/startStopState',
        data: data
    })
}
//工单所属条件查询
export function getWorkOrderList (data) {
    return request({
        url: '/workorder/getWorkOrderList',
        data: data
    })
}
//工单详细信息查询接口
export function getWorkOrder (data) {
    return request({
        url: '/workorder/getWorkOrder',
        data: data
    })
}
//工单信息添加接口
export function saveWorkOrder (data) {
    return request({
        url: '/workorder/saveWorkOrder',
        data: data
    })
}
//可用业务人员查询（工单处理人）
export function getBusinessPersonnelList (data) {
    return request({
        method: 'get',
        url: '/operationUser/getBusinessPersonnelList',
        data: data
    })
}
//工单状态修改接口
export function workOrderStatus (data) {
    return request({
        url: '/workorder/workOrderStatus',
        data: data
    })
}
//工单信息查询接口
export function getWorkOrderByHourseId (data) {
    return request({
        url: '/workorder/getWorkOrderByHourseId',
        data: data
    })
}

//沟通记录添加接口
export function saveCommunicationRecord (data) {
    return request({
        url: '/communicationTypes/saveCommunicationRecord',
        data: data
    })
}
//沟通记录详细信息接口
export function getCommunicationRecord (data) {
    return request({
        url: '/communicationTypes/getCommunicationRecord',
        data: data
    })
}


//=====================================



//沟通类型查询--gm
export function getCommunicationTypes (data) {
    return request({
        url:'/communicationTypes/getCommunicationTypes',
        data:data
    })
}

//沟通类型新增--gm
export function saveCommunicationType (data) {
    return request({
        url:'/communicationTypes/saveCommunicationType',
        data:data
    })
}

//沟通类型编辑--gm
export function updateCommunicationType (data) {
    return request({
        url:'/communicationTypes/updateCommunicationType',
        data:data
    })
}

//坐席列表查询PBX--gm
export function pbxUserServiceList (data) {
     return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=FindAll',
        params:data
    })
}
//坐席列表监听PBX--gm
export function pbxUserServiceMonitor (data) {
     return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Monitor',
        params:data
    })
}
//坐席列表接管/转接PBX--gm
export function pbxUserServiceControl (data) {
     return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Redirect',
        params:data
    })
}
//坐席列表挂断PBX--gm
export function pbxUserServiceHang (data) {
     return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=HangUp',
        params:data
    })
}

//登录--坐席服务队列PBX--gm
export function pbxUserQueueList (data) {
     return getMethods({
        url:'/index.php?module=api.QueueAPI&action=FindAll',
        params:data
    })
}

//登录--坐席分机号队列PBX--gm
export function pbxUserPhoneList (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=FindDevice',
        params:data
    })
}

//登录--坐席分机绑定PBX--gm
export function pbxBindingPhone (data) {
    return getMethods({
        url:'/index.php?module=api.QueueAPI&action=Join',
        params:data
    })
}

//最右侧--队列查询(排队中)PBX--gm
export function pbxQueueSearch (data) {
    return getMethods({
        url:'/index.php?module=api.QueueAPI&action=Detail',
        params:data
    })
}

//最右侧--分机通话记录PBX--gm
export function pbxPhoneHistoryList (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=FindHis',
        params:data
    })
}

//分机接听接口PBX--gm
export function pxbPhoneAnswer (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Select',
        params:data
    })
}

//历史通话的回拨电话接口PBX--gm
export function pxbPhoneCallback (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Call',
        params:data
    })
}

//分机置闲置忙接口PBX--gm
export function pxbPhoneSwitch (data) {
    return getMethods({
        url:'/index.php?module=api.QueueAPI&action=Pause',
        params:data
    })
}

//分机状态查询接口PBX--gm
export function pxbPhoneState (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Status',
        params:data
    })
}

//呼叫中心通话记录接口PBX--gm
export function pxbAllPhoneHistory (data) {
    return getMethods({
        url:'/index.php?module=api.DataAPI&action=FindCdr',
        params:data
    })
}

//退出登录时分机退出队列接口PBX--gm
export function pxbPhoneQuitList (data) {
    return getMethods({
        url:'/index.php?module=api.QueueAPI&action=Out',
        params:data
    })

}

//弹屏静音保持接口PBX--gm
export function pxbPhoneMute (data) {
    return getMethods({
        url:'/index.php?module=api.DeviceAPI&action=Hold',
        params:data
    })
}

//弹屏根据电话地址模糊查询房屋--gm
export function popUpHouseList (data) {
    return request({
        url:'/house/getPopUpHouseList',
        data:data
    })
}

//弹屏选择房屋查询信息--gm
export function popChooseHouseMesg (data) {
    return request({
        url:'/house/getProjectileScreen',
        data:data
    })
}

//弹屏选择房屋查询信息--gm
export function popChooseHouseClienteleMesg (data) {
    return request({
        url:'/clientele/queryClienteleDetail',
        data:data
    })
}

//弹屏删除客户信息--gm
export function popDeteleClienteleMesg (data) {
    return request({
        url:'/clientele/removeClientele',
        data:data
    })
}

//弹屏删除设备信息--gm
export function popDeteleDeviceMesg (data) {
    return request({
        url:'/equipmentInfo/removeDevice',
        data:data
    })
}

//弹屏设备的类型查询--gm
export function getEquipmentClasses (data) {
    return request({
        url:'/equipmentInfo/getEquipmentClasses',
        data:data
    })
}

//弹屏设备的品牌查询--gm
export function getTrademarks (data) {
    return request({
        url:'/equipmentInfo/getTrademarks',
        data:data
    })
}

//弹屏设备的型号查询--gm
export function getEquiModels (data) {
    return request({
        url:'/equipmentInfo/getModels',
        data:data
    })
}

//弹屏新增编辑设备--gm
export function saveOrModifyDevice (data) {
    return request({
        url:'/equipmentInfo/saveOrModifyDevice',
        data:data
    })
}

//弹屏保存按钮--新增房屋--gm
export function saveHouse (data) {
    return request({
        url:'/house/saveHouse',
        data:data
    })
}


//弹屏房屋区域--gm
export function getXzqhInfo (data) {
    return request({
        url:'/xzqh/getXzqhInfo',
        data:data
    })
}
//登录设备运行的key的获取--gm
export function equiLogin (data) {
    return equiMethods({
        url:'/login.json',
        params:data
    })
}
//设备运行当前情况--gm
export function getDevData (data) {
    return equiMethods({
        url:'/getDevData.json',
        params:data
    })
}
//设备运行历史监控情况--gm
export function getDevHisData (data) {
    return equiMethods({
        url:'/getDevHisData.json',
        params:data
    })

}

// 地图接口
export function getMapMemInfo (data) {
  return request({
    url:'/operationMonitoring/getOperationMonitoringTotal',
    data:data
  })
}

// 获取设备坐标
export function getEquipmentCoordinate (data) {
  return request({
    url:'/operationMonitoring/getEquipmentCoordinate',
    data:data
  })
}

// 获取人员坐标
export function getOperationUserCoordinate (data) {
  return request({
    url:'operationMonitoring/getOperationUserCoordinate',
    data:data
  })
}

// 获取完成时间
export function getCompletionTime (data) {
  return request({
    url:'/operationMonitoring/getMaintenanceCompletionTimeTotal',
    data:data
  })
}
// 工单任务类型处理统计
export function getTaskType (data) {
  return request({
    url:'/operationMonitoring/getTaskTypeStatistics',
    data:data
  })
}

// 行政区划统计
export function getArea(data) {
  return request({
    url:'/operationMonitoring/getAreaAndEquipmentTotal',
    data:data
  })
}

// 获取该机构所有维修人员坐标及信息和所有设备坐标
export function getOperationMonitoring(data) {
  return request({
    url:'/operationMonitoring/getOperationMonitoringCoordinate',
    data:data
  })
}

// 获取当前用户任务工单路径接口
export function getWorkOrderRoute(data) {
  return request({
    url:'/operationMonitoring/operationWorkOrderRoute',
    data:{userId:data}
  })
}

export function getDevStatus(data) {
  return equiMethods({
    url:`/getDevStatus.json`,
    params:data
  })
}

export function getWeather(data) {
  return request({
    url:'/public/getWeather',
    data:data
  })
}

//工单回访接口--gm
export function workOrderVisit(data) {
  return request({
    url:'/workorder/workOrderVisit',
    data:data
  })
}

//弹屏获取sbid和ddid的接口--gm
export function getYxqkByHouseId(data) {
  return request({
    url:'/house/getYxqkByHouseId',
    data:data
  })
}

